<?php

namespace app\api\controller;

use app\common\controller\Api;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['index', 'init', 'guesslike'];

    /**
     * 首页
     */
    public function index()
    {
        $this->success('');
    }

    /**
     * 初始化
     */
    public function init()
    {
        $this->success('', [
            'platform_phone'    => '18982680009',
            'notice'            => model('Article')->getNotice(),
            'banner'            => model('Navigation')->getBanner(),
            'category'          => model('Navigation')->getCategory()
        ]);
    }

    /**
     * 猜你喜欢
     */
    public function guesslike()
    {
        $integralGoods = model('IntegralGoods')->getHomoRecommend();
        $this->success('', $integralGoods);
    }
}
